﻿using System;
using System.Drawing;
using System.Windows.Media;
using System.Xml;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data;
using DeveloperUtility.Security;

using NetExp.MediaXenter.Database;

namespace NetExp.MediaXenter.Utilities
{
    public static class Helper
    {
        public static bool isFirstStartup()
        {
            DirectoryInfo dinfo = new DirectoryInfo(Constants.SETTINGSPATH);
            return !dinfo.Exists;
        }


        public static void Inizialize()
        {
            DirectoryInfo dinfo = new DirectoryInfo(Constants.SETTINGSPATH);
            dinfo.Create();
        }


        public static System.Windows.Media.Color GetColor(string colore)
        {
            System.Windows.Media.Color color = new System.Windows.Media.Color();
            if (colore.StartsWith("#"))
            {
                color = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString(colore);
            }
            else
            {
                color = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString(colore);
            }

            return color;
        }

        public static Font GetFont(string fontName, float fontSize, bool bold, bool italic, bool underline)
        {
            System.Drawing.FontStyle fontStyle = new System.Drawing.FontStyle();

            if (bold)
                fontStyle |= System.Drawing.FontStyle.Bold;
            if (italic)
                fontStyle |= System.Drawing.FontStyle.Italic;
            if (underline)
                fontStyle |= System.Drawing.FontStyle.Underline;

            Font font = new Font(fontName, fontSize, fontStyle);
            return font;
        }
    }
}
